package main;
import java.util.ArrayList;
import java.util.PriorityQueue;


public class FinalIDX implements Comparable<FinalIDX>{
	
	public String name;
	public int frequency;
	public ArrayList<Integer> documents = new ArrayList<Integer>();
	//public PriorityQueue<Integer> documents = new PriorityQueue<Integer>();
	
	public FinalIDX(String n, int doc) {
		name = n;
		frequency = 1;
		documents.add(doc);
	}

	public void addDocument(int documents2) {
		frequency++;
		documents.add(documents2);
	}

	@Override
	public int compareTo(FinalIDX o) {
		
		return this.name.compareTo(o.name);
	}
	
	public String toString() {
		String ret = "Name: "+name+" Documents: ";
		for(int i = 0; i < frequency; i++) {
			ret += documents.get(i) + ", ";
		}
		return ret;
	}

}
